from django.db import models

importance_choices = (
    ('A', 'very importance'),
    ('B', 'importance'),
    ('C', 'medium'),
    ('D', 'unimportance'),
)


class Todo(models.Model):
    title = models.CharField(max_length=200, unique=True)
    description = models.TextField()
    importance = models.CharField(max_length=1, choices=importance_choices)

    def __unicode__(self):
        return self.title

    def text_importance(self):
        choices = dict(importance_choices)
        return choices[self.importance]
